// utils/mockData.js
// 模拟数据（基于数据库结构）

// 课程分类
export const courseCategories = [
  { id: 1, name: '编程开发', parent_id: null, sort_order: 1, icon: '💻' },
  { id: 2, name: '设计创意', parent_id: null, sort_order: 2, icon: '🎨' },
  { id: 3, name: '商业管理', parent_id: null, sort_order: 3, icon: '📊' },
  { id: 4, name: '语言学习', parent_id: null, sort_order: 4, icon: '🌐' },
  { id: 5, name: '考试认证', parent_id: null, sort_order: 5, icon: '📝' },
  { id: 6, name: '职业技能', parent_id: null, sort_order: 6, icon: '🛠️' }
]

// 课程列表数据（匹配数据库结构）
export const courses = [
  {
    id: 1,
    teacher_id: 1,
    category_id: 1,
    title: '微信小程序开发实战',
    cover_image: '/images/course1.jpg',
    description: '从零到一掌握微信小程序开发，包含完整实战项目。本课程将带你深入了解小程序的核心概念、组件使用、API调用等内容，并通过实战项目巩固所学知识。',
    price: 199.00,
    original_price: 299.00,
    difficulty_level: 'intermediate',
    status: 'published',
    tags: '实战,项目,小程序',
    student_count: 1234,
    rating: 4.8,
    review_count: 567,
    teacher: {
      id: 1,
      user_id: 1,
      real_name: '张明',
      avatar_url: '/images/teacher1.jpg',
      teacher_level: 'senior',
      introduction: '10年前端开发经验，精通小程序开发',
      hourly_rate: 200.00,
      is_verified: true
    },
    category: {
      id: 1,
      name: '编程开发'
    },
    chapters: [
      {
        id: 1,
        chapter_title: '第一章：小程序基础',
        sort_order: 1,
        lessons: [
          { 
            id: 1, 
            lesson_title: '1.1 小程序简介', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 1200, 
            sort_order: 1, 
            is_free: true 
          },
          { 
            id: 2, 
            lesson_title: '1.2 开发环境搭建', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 1800, 
            sort_order: 2, 
            is_free: true 
          },
          { 
            id: 3, 
            lesson_title: '1.3 第一个小程序', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 2100, 
            sort_order: 3, 
            is_free: false 
          }
        ]
      },
      {
        id: 2,
        chapter_title: '第二章：核心组件',
        sort_order: 2,
        lessons: [
          { 
            id: 4, 
            lesson_title: '2.1 视图容器组件', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 2400, 
            sort_order: 1, 
            is_free: false 
          },
          { 
            id: 5, 
            lesson_title: '2.2 基础内容组件', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 2100, 
            sort_order: 2, 
            is_free: false 
          }
        ]
      },
      {
        id: 3,
        chapter_title: '第三章：实战项目',
        sort_order: 3,
        lessons: [
          { 
            id: 6, 
            lesson_title: '3.1 项目需求分析', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 1800, 
            sort_order: 1, 
            is_free: false 
          },
          { 
            id: 7, 
            lesson_title: '3.2 项目实现', 
            lesson_type: 'live', 
            live_start_time: '2025-01-15 19:00:00', 
            sort_order: 2, 
            is_free: false 
          }
        ]
      }
    ],
    is_live: false,
    next_live_time: '2025-01-15 19:00:00',
    created_at: '2024-12-01 10:00:00'
  },
  {
    id: 2,
    teacher_id: 2,
    category_id: 2,
    title: 'UI/UX设计精品课',
    cover_image: '/images/course2.jpg',
    description: '系统学习UI/UX设计原理，掌握专业设计技能。涵盖设计思维、用户研究、原型设计、视觉设计等全流程内容。',
    price: 299.00,
    original_price: 399.00,
    difficulty_level: 'beginner',
    status: 'published',
    tags: '设计,交互,UI,UX',
    student_count: 856,
    rating: 4.9,
    review_count: 423,
    teacher: {
      id: 2,
      user_id: 2,
      real_name: '李雪',
      avatar_url: '/images/teacher2.jpg',
      teacher_level: 'senior',
      introduction: '资深UI/UX设计师，曾就职于知名互联网公司',
      hourly_rate: 250.00,
      is_verified: true
    },
    category: {
      id: 2,
      name: '设计创意'
    },
    chapters: [
      {
        id: 4,
        chapter_title: '第一章：设计基础',
        sort_order: 1,
        lessons: [
          { 
            id: 8, 
            lesson_title: '1.1 设计思维入门', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 1500, 
            sort_order: 1, 
            is_free: true 
          },
          { 
            id: 9, 
            lesson_title: '1.2 色彩理论', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 1800, 
            sort_order: 2, 
            is_free: false 
          }
        ]
      },
      {
        id: 5,
        chapter_title: '第二章：用户研究',
        sort_order: 2,
        lessons: [
          { 
            id: 10, 
            lesson_title: '2.1 用户画像', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 2000, 
            sort_order: 1, 
            is_free: false 
          },
          { 
            id: 11, 
            lesson_title: '2.2 用户访谈', 
            lesson_type: 'live', 
            live_start_time: '正在直播中', 
            sort_order: 2, 
            is_free: false, 
            live_status: 'live' 
          }
        ]
      }
    ],
    is_live: true,
    next_live_time: '正在直播中',
    created_at: '2024-11-20 10:00:00'
  },
  {
    id: 3,
    teacher_id: 3,
    category_id: 1,
    title: 'Python数据分析与挖掘',
    cover_image: '/images/course3.jpg',
    description: '使用Python进行数据分析和挖掘实战，学习pandas、numpy等常用库，掌握数据清洗、可视化、建模等技能。',
    price: 249.00,
    original_price: 349.00,
    difficulty_level: 'advanced',
    status: 'published',
    tags: '数据分析,Python,机器学习',
    student_count: 2100,
    rating: 4.7,
    review_count: 890,
    teacher: {
      id: 3,
      user_id: 3,
      real_name: '王强',
      avatar_url: '/images/teacher3.jpg',
      teacher_level: 'senior',
      introduction: '数据科学专家，精通Python和机器学习',
      hourly_rate: 300.00,
      is_verified: true
    },
    category: {
      id: 1,
      name: '编程开发'
    },
    chapters: [
      {
        id: 6,
        chapter_title: '第一章：Python基础',
        sort_order: 1,
        lessons: [
          { 
            id: 12, 
            lesson_title: '1.1 Python环境搭建', 
            lesson_type: 'video', 
            video_url: 'https://www.w3school.com.cn/example/html5/mov_bbb.mp4',
            video_duration: 1200, 
            sort_order: 1, 
            is_free: true 
          }
        ]
      }
    ],
    is_live: false,
    next_live_time: '2025-01-16 20:00:00',
    created_at: '2024-11-15 10:00:00'
  },
  {
    id: 4,
    teacher_id: 1,
    category_id: 3,
    title: '产品经理实战训练营',
    cover_image: '/images/course4.jpg',
    description: '从0到1培养产品思维，学习需求分析、产品设计、项目管理等核心技能。',
    price: 399.00,
    original_price: 599.00,
    difficulty_level: 'intermediate',
    status: 'published',
    tags: '产品经理,项目管理,需求分析',
    student_count: 678,
    rating: 4.6,
    review_count: 234,
    teacher: {
      id: 1,
      user_id: 1,
      real_name: '张明',
      avatar_url: '/images/teacher1.jpg',
      teacher_level: 'senior',
      introduction: '10年产品经验，曾负责多款千万级用户产品',
      hourly_rate: 200.00,
      is_verified: true
    },
    category: {
      id: 3,
      name: '商业管理'
    },
    chapters: [],
    is_live: false,
    next_live_time: '2025-01-18 19:00:00',
    created_at: '2024-12-05 10:00:00'
  }
]

// 商品（书籍资料）数据
export const products = [
  {
    id: 1,
    name: '微信小程序开发指南（第3版）',
    description: '全面介绍微信小程序开发技术，包含最新API和最佳实践，附带完整案例代码。',
    cover_image: '/images/book1.jpg',
    author: '张明 等',
    price: 49.00,
    stock_quantity: 500,
    is_recommended: true,
    status: 'published',
    sales_count: 1234,
    rating: 4.6,
    review_count: 567,
    created_at: '2024-10-01 10:00:00'
  },
  {
    id: 2,
    name: 'UI设计原理与实践',
    description: 'UI设计的核心原理和实战案例，适合初学者和进阶设计师。',
    cover_image: '/images/book2.jpg',
    author: '李雪',
    price: 59.00,
    stock_quantity: 300,
    is_recommended: true,
    status: 'published',
    sales_count: 856,
    rating: 4.8,
    review_count: 423,
    created_at: '2024-09-15 10:00:00'
  },
  {
    id: 3,
    name: 'Python数据分析实战',
    description: '深入浅出讲解Python数据分析，涵盖pandas、matplotlib等主流工具。',
    cover_image: '/images/book3.jpg',
    author: '王强',
    price: 69.00,
    stock_quantity: 450,
    is_recommended: false,
    status: 'published',
    sales_count: 654,
    rating: 4.7,
    review_count: 289,
    created_at: '2024-08-20 10:00:00'
  },
  {
    id: 4,
    name: '产品经理实战手册',
    description: '产品经理必备技能全解析，从需求分析到产品上线。',
    cover_image: '/images/book4.jpg',
    author: '张明',
    price: 79.00,
    stock_quantity: 200,
    is_recommended: true,
    status: 'published',
    sales_count: 432,
    rating: 4.5,
    review_count: 156,
    created_at: '2024-11-01 10:00:00'
  }
]

// 兼容旧代码
export const books = products

// 练习题数据
export const practiceQuestions = [
  {
    id: 1,
    course_id: 1,
    question_type: 'single_choice',
    question_text: '微信小程序的配置文件是？',
    options: ['app.json', 'app.js', 'app.wxss', 'app.wxml'],
    correct_answer: 'app.json',
    explanation: 'app.json是小程序的全局配置文件，包含页面路径、窗口表现、网络超时等配置。',
    points: 5
  },
  {
    id: 2,
    course_id: 1,
    question_type: 'multiple_choice',
    question_text: '以下哪些是小程序的生命周期函数？',
    options: ['onLoad', 'onShow', 'onReady', 'onCreate'],
    correct_answer: 'onLoad,onShow,onReady',
    explanation: 'onLoad、onShow、onReady都是小程序页面的生命周期函数，onCreate不是。',
    points: 10
  },
  {
    id: 3,
    course_id: 2,
    question_type: 'single_choice',
    question_text: 'UI设计的三大原则不包括？',
    options: ['一致性', '反馈性', '复杂性', '简洁性'],
    correct_answer: '复杂性',
    explanation: 'UI设计强调简洁性而非复杂性，复杂的设计会降低用户体验。',
    points: 5
  }
]

// 作业数据
export const assignments = [
  {
    id: 1,
    course_id: 1,
    title: '第一章作业：创建第一个小程序',
    description: '根据课程所学，创建一个简单的小程序，包含首页和个人中心两个页面。',
    total_points: 100,
    due_date: '2025-01-20 23:59:59',
    created_at: '2025-01-10 10:00:00'
  },
  {
    id: 2,
    course_id: 2,
    title: '设计思维练习',
    description: '选择一个日常使用的APP，分析其UI设计的优缺点。',
    total_points: 100,
    due_date: '2025-01-25 23:59:59',
    created_at: '2025-01-12 10:00:00'
  }
]

// 热门推荐
export const hotRecommendations = [
  { id: 1, title: '本周热销课程', type: 'course', items: courses.slice(0, 3) },
  { id: 2, title: 'AI推荐课程', type: 'course', items: [courses[0], courses[2]] },
  { id: 3, title: '热门学习资料', type: 'product', items: products.filter(p => p.is_recommended) }
]

// 难度等级映射
export const difficultyMap = {
  'beginner': '初级',
  'intermediate': '中级',
  'advanced': '高级'
}

// 讲师等级映射
export const teacherLevelMap = {
  'junior': '初级讲师',
  'intermediate': '中级讲师',
  'senior': '高级讲师'
}